<HTML><HEAD><TITLE>vs_random_index(+VS, -Var)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(tentative)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>vs_random_index(+VS, -Var)</H1>
Retrieve a random variable index from a varset
<DL>
<DT><EM>VS</EM></DT>
<DD>A varset
</DD>
<DT><EM>Var</EM></DT>
<DD>An integer (output)
</DD>
</DL>
<H2>Description</H2>

	Retrieve a random variable index from a varset.
    
<H3>Modes and Determinism</H3><UL>
<LI>vs_random_index(+, -) is semidet
</UL>
<H2>Examples</H2>
<PRE>
    ?- Vars=[A,B,C], tent_set(Vars, [a,b,c]), vs_create(Vars, VS),
       vs_random(VS, I).
    Vars = [A{a -&gt; 0}, B{b -&gt; 0}, C{c -&gt; 0}]
    VS = ...
    I = 1		% 1, 2 or 3, the result is random!
    Yes (0.00s cpu)
    </PRE>
<H2>See Also</H2>
<A HREF="../../lib/tentative/vs_create-2.html">vs_create / 2</A>, <A HREF="../../lib/tentative/vs_element-3.html">vs_element / 3</A>, <A HREF="../../lib/tentative/vs_random-2.html">vs_random / 2</A>
</BODY></HTML>
